<!-- 通用组件：计数器 -->
<template>
    <div :id="id">
        <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
    </div>
</template>

<script>
    import register from '@/js/main/register.js';

    export default {
        props: {
            element: {
                type: Object
            },
            id: {
                type: String
            }
        },
        data() {
            return {
                num: 1
            }
        },
        created() {
            register.addComponent(this);
        },
        methods: {
            handleChange(value) {
                console.log(value);
            }
        },
        destroyed() {
            register.removeComponent(this);
        }
    }
</script>